﻿using System;

namespace CP_SchoolForChildren_v0._1.Controllers.Fuzzy
{
    public class Education
    {
        public double InvestIt;
        public double InvestBt;
        public double InvestNhieu;

        public Education()
        {
            InvestIt = 0;
            InvestBt = 0;
            InvestNhieu = 0;
        }
        
        public void GetInvestLevel(double education)
        {
            // Map with min in Data
            if (education <= 0.8)
            {
                InvestIt = 1;
            }
            else if (education > 0.8 && education < 1.5)
            {
                InvestBt = (education - 0.8) / 0.7;
                InvestIt = 1 - InvestBt;
            }
            else if (education == 1.5)
            {
                InvestBt = 1;
            }
            else if (education > 1.5 && education < 3)
            {
                InvestNhieu = (education - 1.5) / 1.5;
                InvestBt = 1 - InvestNhieu;
            }
            else if (education >= 3)
            {
                InvestNhieu = 1;
            }
        }

        public void Display()
        {
            Console.WriteLine("InvestIt " + InvestIt);
            Console.WriteLine("InvestBt " + InvestBt);
            Console.WriteLine("InvestNhieu " + InvestNhieu);

        }
    }
}
